package com.xzl.xep.pojo;

import javax.persistence.Entity;
import javax.persistence.Table;
import javax.validation.constraints.NotNull;

import org.hibernate.validator.constraints.NotBlank;

@Entity
@Table(name="dp_company")
public class Company extends IdEntity {

	@NotBlank
	private String name;
	
	@NotNull
	private Double cashLast;
	
	@NotNull
	private Double cashToday;
	
	@NotNull
	private Double cashPlus;
	
	@NotNull
	private Double cashMinus;

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public Double getCashLast() {
		return cashLast;
	}

	public void setCashLast(Double cashLast) {
		this.cashLast = cashLast;
	}

	public Double getCashToday() {
		return cashToday;
	}

	public void setCashToday(Double cashToday) {
		this.cashToday = cashToday;
	}

	public Double getCashPlus() {
		return cashPlus;
	}

	public void setCashPlus(Double cashPlus) {
		this.cashPlus = cashPlus;
	}

	public Double getCashMinus() {
		return cashMinus;
	}

	public void setCashMinus(Double cashMinus) {
		this.cashMinus = cashMinus;
	}
	
	
	public void plusCash(Double money){
		this.cashPlus += money;
		this.cashToday += money;
	}
	
	public void minusCash(Double money){
		this.cashMinus += money;
		this.cashToday -= money;
	}
	
}
